<template>
	<view :class="isDark?'darkBg':''">
		<cu-custom :bgColor="isDark?'bg-black':'bg-orange'" isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">录取结果</block>
		</cu-custom>
		<view style="height: 545rpx; background-size: cover;  background-position: center;"
			:style="{backgroundImage:isDark?'url(https://web.cloudduolc.cn/image/adblack7.png)':'url(https://web.cloudduolc.cn/image/adwhite5.png)'}">
			<ad unit-id="adunit-b1c61a406515258a" ad-type="video" :ad-theme="isDark?'black':'white'"></ad>
		</view>
		<view :class="isDark?'dark':''">
			<view class="cu-bar  solid-bottom" style="font-weight:bold" :class="isDark?'dark':'bg-white'">
				<view class="action">
					<text class="cuIcon-titles text-orange"></text> 录取结果
				</view>
			</view>
			<view class="margin  padding radius " :class="isDark?'darkIn':'bg-white'">
				<view style="border: 5rpx solid gray;margin-top: 30rpx;">
					<view style="text-align: center;width: 100%;padding-top:20rpx">录取查询结果</view>
					<view>
						<view class="margin" style="border-bottom: 5rpx solid gray;">
							<span>考生号:</span><span class="margin-left-xl"
								style="float:right;margin-right:30rpx">{{kh}}</span>
						</view>
						<view class="margin" style="border-bottom: 5rpx solid gray;">
							<span>姓名:</span><span class="margin-left-xl"
								style="float:right;margin-right:30rpx">{{data.name}}</span>
						</view>
						<view class="margin" style="border-bottom: 5rpx solid gray;">
							<span>录取类别:</span><span class="margin-left-xl"
								style="float:right;margin-right:30rpx">{{data.type}}</span>
						</view>
						<view class="margin" style="border-bottom: 5rpx solid gray;">
							<span>录取专业:</span><span class="margin-left-xl"
								style="float:right;margin-right:30rpx">{{data.major}}</span>
						</view>
						<view class="margin" style="border-bottom: 5rpx solid gray;">
							<span>学制:</span><span class="margin-left-xl"
								style="float:right;margin-right:30rpx">{{data.eductionalSystme}}</span>
						</view>
						<view class="margin" style="border-bottom: 5rpx solid gray;">
							<span>所属学院:</span><span class="margin-left-xl"
								style="float:right;margin-right:30rpx">{{data.teachchildren}}</span>
						</view>
						<view class="margin" style="border-bottom: 5rpx solid gray;" @click="kdh">
							<span>快递号:</span><span class="margin-left-xl"
								style="float:right;margin-right:30rpx">{{data.mailNum}}</span>
						</view>
						<view class="margin" style="border-bottom: 5rpx solid gray;height: 160rpx;">
							<view>邮寄地点:</view>
							<view class="margin-left-xl margin-top" style="float:right;margin-right:30rpx">
								{{data.address}}
							</view>
						</view>
						<view class="margin">
							<text style="color: red;">注: 查询结果仅供参考，最终的录取结果请以收到的录取通知书为准。</text>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view :class="isDark?'dark':''" style="height: 200rpx;"></view>
		<zmm-watermark>

		</zmm-watermark>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				kh: '',
				xm: '',
				sfzh: '',
				isDark: this.isDark,
				data: {}

			}
		},
		onShow() {
			let _this = this
			_this.kh = _this.$store.state.enrollInfo.kh
			_this.xm = _this.$store.state.enrollInfo.xm
			_this.sfzh = _this.$store.state.enrollInfo.sfzh
			_this.formSubmit()
		},

		methods: {
			kdh() {
				let _this = this
				uni.setClipboardData({
					data: _this.data.mailNum,
				});
			},
			formSubmit: function() {

				let _this = this
				let form = {
					kh: _this.$store.state.enrollInfo.kh,
					xm: _this.$store.state.enrollInfo.xm,
					sfzh: _this.$store.state.enrollInfo.sfzh,
				}

				_this.$schoolApi.enrollInfo(form).then(function(response) {
					console.log(response)
					if (response.status == 0) {
						console.log(response.data)
						_this.data = response.data
						uni.showToast({
							icon: 'none',
							title: '查询成功',
							duration: 2000
						});

					} else if (response.status != 608 && response.status != 603) {
						uni.showModal({
							title: '提示',
							content: response.msg,
							showCancel: false,
							success: function(res) {
								if (res.confirm) {

								} else if (res.cancel) {

								}
							}
						});
					}

					//这里只会在接口是成功状态返回
				}).catch(function(error) {
					//这里只会在接口是失败状态返回，不需要去处理错误提示
					console.log(error);




				});
			},

		}

	}
</script>

<style>
	.form {
		margin: 10rpx;
	}

	.imgCodeSrc {
		margin-top: 30rpx;
	}

	.viewInput {
		margin-left: 30rpx;
		margin-bottom: 20rpx;
	}

	.uni-form-item .title {
		padding: 20rpx 0;
	}

	.input {
		border: 1px solid #ccc;
		border-radius: 3px;
		margin-right: 20rpx;
		font-size: 17px;
		font-family: "Microsoft soft";
		padding: 7px 7px;
	}
</style>
